Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add lapack #4

Closed
wants to merge 12 commits into from
Closed

WIP: Add lapack #4

wants to merge 12 commits into from

Conversation

IsabelParedes
Copy link
Owner

@IsabelParedes IsabelParedes commented May 20, 2024

  • Build packages with LFortran

To replicate locally

  1. Create an environment
    micromamba create -n emscripten-forge -f ci_env.yml
  2. Set up pixi
    pixi run setup
  3. Build package
    pixi run build-emscripten-wasm32-pkg recipes/recipes_emscripten/lapack

@IsabelParedes
Copy link
Owner Author

IsabelParedes commented May 20, 2024

 │ │ -- The Fortran compiler identification is unknown
 │ │ -- Detecting Fortran compiler ABI info
 │ │ -- Detecting Fortran compiler ABI info - failed
 │ │ -- Check for working Fortran compiler: $BUILD_PREFIX/bin/lfortran
 │ │ -- Check for working Fortran compiler: $BUILD_PREFIX/bin/lfortran - broken
 │ │ CMake Error at /usr/local/share/cmake-3.29/Modules/CMakeTestFortranCompiler.cmake:59 (message):
 │ │   The Fortran compiler
 │ │     "$BUILD_PREFIX/bin/lfortran"
 │ │   is not able to compile a simple test program.
 │ │   It fails with the following output:
 │ │     Change Dir: '/home/runner/work/emscripten-forge-recipes/emscripten-forge-recipes/output/bld/rattler-build_libblas_1716216555/work/build/CMakeFiles/CMak
 │ │ eScratch/TryCompile-zrIny3'

This error appears when running

# CMakeLists.txt
enable_language(Fortran)

@IsabelParedes
Copy link
Owner Author

 │ │ -- Detecting Fortran/C Interface
 │ │ Failed to compile
 │ │ -- Verifying Fortran/C Compiler Compatibility
 │ │ CMake Warning (dev) at /usr/local/share/cmake-3.29/Modules/FortranCInterface.cmake:309 (message):
 │ │   No FortranCInterface mangling known for VerifyFortran
 │ │ Call Stack (most recent call first):
 │ │   /usr/local/share/cmake-3.29/Modules/FortranCInterface/Verify/CMakeLists.txt:16 (FortranCInterface_HEADER)
 │ │ This warning is for project developers.  Use -Wno-dev to suppress it.
 │ │ -- Verifying Fortran/C Compiler Compatibility - Failed
 │ │ CMake Error at /usr/local/share/cmake-3.29/Modules/FortranCInterface.cmake:398 (message):
 │ │   The Fortran compiler:
 │ │     $BUILD_PREFIX/bin/lfortran
 │ │   and the C compiler:
 │ │     /home/runner/work/emscripten-forge-recipes/emscripten-forge-recipes/emsdk_install/upstream/emscripten/emcc
 │ │   failed to compile a simple test project using both languages.  The output
 │ │   was:
 │ │     Change Dir: '/home/runner/work/emscripten-forge-recipes/emscripten-forge-recipes/output/bld/rattler-build_libblas_1716219458/work/build/CMakeFiles/Fort
 │ │ ranCInterface/VerifyC'

This error comes from

# LAPACKE/include/CMakeLists.txt
FortranCInterface_VERIFY()

@IsabelParedes IsabelParedes changed the title Add lapack WIP: Add lapack May 20, 2024
@IsabelParedes
Copy link
Owner Author

The following argument was not expected: -pp

This error comes from

# BLAS/SRC/CMakeLists.txt
- set(COPT_64_F -cpp)
+ set(COPT_64_F --cpp)

@IsabelParedes
Copy link
Owner Author

 │ │ [ 19%] Building Fortran object SRC/CMakeFiles/lapack.dir/sgeqr2p.f.o
 │ │ cd /home/runner/work/emscripten-forge-recipes/emscripten-forge-recipes/output/bld/rattler-build_libblas_1716221689/work/build/SRC && $BUILD_PREFIX/bin/lfor
 │ │ tran   --fixed-form-infer --implicit-interface -c /home/runner/work/emscripten-forge-recipes/emscripten-forge-recipes/output/bld/rattler-build_libblas_1716
 │ │ 221689/work/SRC/sgeqr2p.f -o CMakeFiles/lapack.dir/sgeqr2p.f.o
 │ │ syntax error: Newline is unexpected here
 │ │    --> /home/runner/work/emscripten-forge-recipes/emscripten-forge-recipes/output/bld/rattler-build_libblas_1716221689/work/SRC/sgeqp3rk.f:954:54
 │ │     |
 │ │ 954 |      $                     N+NRHS-J+1, IWORK, IINFO )
 │ │     |                                                      ^ 
 │ │ Note: Please report unclear, confusing or incorrect messages as bugs at
 │ │ https://github.com/lfortran/lfortran/issues.
 │ │ make[2]: *** [SRC/CMakeFiles/lapack.dir/build.make:478: SRC/CMakeFiles/lapack.dir/sgeqp3rk.f.o] Error 1
 │ │ make[2]: *** Waiting for unfinished jobs....

Not sure if this is an actual syntax error. The SRC/sgeqp3rk.f file has the following:

*           Factorize JB columns among the columns A(J:N).
*
           CALL SLAQP3RK( M, N_SUB, NRHS, IOFFSET, JB, ABSTOL,
    $                     RELTOL, KP1, MAXC2NRM, A( 1, J ), LDA,
    $                     DONE, JBF, MAXC2NRMK, RELMAXC2NRMK,
    $                     JPIV( J ), TAU( J ),
    $                     WORK( J ), WORK( N+J ),
    $                     WORK( 2*N+1 ), WORK( 2*N+JB+1 ),
    $                     N+NRHS-J+1, IWORK, IINFO )
*
*           Set INFO on the first occurence of Inf.
*

After reaching 19%, it seems to hang forever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant